package com.example.springbootdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IDEA
 * Author:weicheng huang
 * Date : 2018/4/11
 */
@Controller
public class HelloController {

    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/index")
    public String index() {
        return "index";
    }

    @RequestMapping("/vue")
    public String vue() {
        return "vue";
    }

    @ResponseBody
    @RequestMapping("/getDate")
    public String getNumber() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        String format = simpleDateFormat.format(new Date());
        return format;
    }
}
